import json
from backend.celery_worker import celery_app
from backend.common.logging import logger

@celery_app.task
def add(x, y):
    logger.info(f'[ADD TASK] {x} + {y} = {x + y}')
    return x + y


@celery_app.task
def restart_rap(app_uuid: str):
    logger.info(f'[RESTART RAP] App UUID: {app_uuid}')

    logger.info(f"查询当前{app_uuid}的运行状态")

    logger.info(f"如果不再运行就重启服务")


    logger.info(f"在运行中就不重启服务, 且等待")
    # 这里可以添加重启服务的逻辑
    return  {"app_uuid": app_uuid, "status": "重启服务成功"}
